package ar.com.aterrizar.ui;

import org.uqbar.arena.actions.MessageSend;
import org.uqbar.arena.layout.HorizontalLayout;
import org.uqbar.arena.layout.VerticalLayout;
import org.uqbar.arena.widgets.Button;
import org.uqbar.arena.widgets.Label;
import org.uqbar.arena.widgets.Panel;
import org.uqbar.arena.windows.Window;
import org.uqbar.arena.windows.WindowOwner;
import ar.com.aterrizar.entidades.Cliente;
import ar.com.aterrizar.uimodels.AdminOperationModel;
import ar.com.aterrizar.uimodels.AeropuertoComprasModel;
import ar.com.aterrizar.uimodels.AeropuertoReservasModel;
import ar.com.aterrizar.uimodels.AeropuertoSobreReservasModel;
import ar.com.aterrizar.uimodels.ComprasModel;
import ar.com.aterrizar.uimodels.OperationModel;
import ar.com.aterrizar.uimodels.ReservasModel;

public class AdminOperationWindow extends Window<AdminOperationModel> {
	public AdminOperationWindow(WindowOwner parent){
		super(parent, new AdminOperationModel());
	}

	@Override
	public void createContents(Panel mainPanel) {
		this.setTitle("Aterrizar.com.ar");
		
		mainPanel.setLayout(new VerticalLayout());
		
		new Label(mainPanel).setText("Bienvenido Administrador");
		new Label(mainPanel).setText("¿Qué desea hacer?");	
		
		Panel actionsPanel = new Panel(mainPanel).setLayout(new HorizontalLayout());

		new Button(actionsPanel)
			.setCaption("Ver Compras")
			.onClick(new MessageSend(this, "verCompras"));

		new Button(actionsPanel)
			.setCaption("Ver Reservas")
			.onClick(new MessageSend(this, "verReservas"));
	
		new Button(actionsPanel)
			.setCaption("Ver Sobre-Reservas")
			.onClick(new MessageSend(this, "verSobreReservas"));
	}


	public void verCompras(){
		new TransaccionesWindow(getOwner(),new AeropuertoComprasModel()).open();
	}

	public void verReservas(){
		new TransaccionesWindow(getOwner(),new AeropuertoReservasModel()).open();
	}
	
	public void verSobreReservas(){
		new TransaccionesWindow(getOwner(),new AeropuertoSobreReservasModel()).open();
	}

}
